﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ControllerBase : MonoBehaviour
{
    public ShipModelBase shipModel;
    public ShipViewBase shipView;

    public void UpdateView()
    {
        if (shipModel == null || shipView == null)
        {
            return;
        }

        if (shipView.nameText != null)
        {
            shipView.nameText.text = shipModel.Name;
        }
        
        if (shipView.healthText != null)
        {
            shipView.healthText.text ="生命:" +shipModel.Health;
        }

        if (shipView.shieldText != null)
        {
            shipView.shieldText.text = "护盾:" + shipModel.Shield;
        }

        if (shipView.fuelText != null)
        {
            shipView.fuelText.text = "燃料:" + System.Convert.ToInt32(shipModel.Fule);
        }

    
    }

}
